package com.zhiyou100.crm.service.impl;

import com.zhiyou100.crm.dao.CustomerSourceDao;
import com.zhiyou100.crm.service.CustomerSourceService;
import com.zhiyou100.crm.pojo.CustomerSource;
import com.zhiyou100.crm.util.S_session;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.IOException;
import java.util.List;
@Service("customerSourceServiceImpl")
public class CustomerSourceServiceImpl implements CustomerSourceService {
//    CustomerSourceDao customerSourceDao=new CustomerSourceDaoImpl();
    @Autowired
    private CustomerSourceDao customerSourceDao;
    @Override
    public List<CustomerSource> qureyAll() throws IOException {
        List<CustomerSource> customerSources =customerSourceDao.qureyAll();
        return customerSources;
    }

    @Override
    public int delete(int id) throws IOException {
        int a =customerSourceDao.delete(id);
        return a;
    }

    @Override
    public int add(CustomerSource customerSource) throws IOException {
        int a =customerSourceDao.add(customerSource);
        return a;
    }

    @Override
    public int update(CustomerSource customerSource) throws IOException {
        int a =customerSourceDao.update(customerSource);
        return a;
    }
}
